package com.zju.DoctorGo.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zju.DoctorGo.dto.DoctorDTO;
import com.zju.DoctorGo.entity.Doctor;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DoctorMapper extends BaseMapper<Doctor> {

    int createDoctor(Doctor doctor);

    @Select("SELECT * FROM doctor")
    List<Doctor> getAllDoctors();

    @Update("UPDATE doctor SET name = #{name}, age = #{age}, gender = #{gender}, specialty = #{specialty} WHERE userId = #{userId}")
    void update(Doctor doctor);

    Integer retrieveDoctorId(String doctorName);
    Doctor retrieveDoctorById(Integer doctorId);

    List<DoctorDTO> retrieveDoctorsBySpecialty(String specialty);

    List<Doctor> retrieveDoctorsBySpecialty2(String specialty);



}
